// 用户端路由
const userRoutes = {
  path: '/user',
  name: 'UserLayout',
  component: () => import('@/views/user/layout.vue'),
  redirect: '/user/home',
  meta: { 
    title: '用户端', 
    requiresAuth: true,
    roles: ['user']
  },
  children: [
    {
      path: 'home',
      name: 'UserHome',
      component: () => import('@/views/user/home.vue'),
      meta: { title: '首页', icon: 'home' }
    },
    {
      path: 'medicine',
      name: 'UserMedicine',
      component: () => import('@/views/user/medicine/index.vue'),
      meta: { title: '药品浏览', icon: 'medicine' }
    },
    {
      path: 'medicine/detail/:id',
      name: 'UserMedicineDetail',
      component: () => import('@/views/user/medicine/detail.vue'),
      meta: { title: '药品详情', icon: 'medicine-detail' },
      hidden: true
    },
    {
      path: 'order',
      name: 'UserOrder',
      component: () => import('@/views/user/order/index.vue'),
      meta: { title: '我的订单', icon: 'order' }
    },
    {
      path: 'order/detail/:id',
      name: 'UserOrderDetail',
      component: () => import('@/views/user/order/detail.vue'),
      meta: { title: '订单详情', icon: 'order-detail' },
      hidden: true
    },
    {
      path: 'cart',
      name: 'UserCart',
      component: () => import('@/views/user/cart/index.vue'),
      meta: { title: '购物车', icon: 'cart' }
    },
    {
      path: 'profile',
      name: 'UserProfile',
      component: () => import('@/views/user/profile/index.vue'),
      meta: { title: '个人中心', icon: 'user' }
    }
  ]
}

export default userRoutes